<script language="JavaScript">
	$(document).ready(function(){
		 $(document.getElementById('${field.name}Id')).inputStyle({
			operatorType:"text",
			operatorText:"选择",
			controllerWidth:'<#if formField??>${formField.width?default('120')}<#else>120</#if>',
			operatorFun:showMenu${field.id}
		});
	});
	
	function viewPlanInfo(id,title,year) {
		var url =TDQS.CONTEXT_PATH+"business/process?tdqssid="+TDQS.SESSION_ID+"&function.id=planresult_func_0000000000000005";   
		url+="&businessProcess.id=planproject_process_000000000000";
		url+="&businessInstance.id="+id+'&isHideButton=1';

		title =title+"("+year+")";

		if(window.parent.curWin == null){
			new Win({
				url:url,
				title:title,
				width:980,
				height:500,
				center:true,
				resizable:false
			});
		}else{
			window.parent.curWin.options.url =url ;
			window.parent.curWin.options.title =title;
			window.parent.curWin.setUrl(url);
			window.parent.curWin.setTitle(title);
		}
	}
	
	function showMenu${field.id}(){
		var id = $('#${field.name}').val();
	
		new Win({
			url:TDQS.CONTEXT_PATH+"foundation/showTJPlanProject?id="+id+"&saveFunction=save${field.id}&cleanFunction=clean${field.id}",
			title:"选择项目来源",
			width:900,
			height:420,
			center:true,
			resizable:false
		});
	}
	
	function save${field.id}(rec){		
		$('#${field.name}Id').val(rec.projectName);
		$('#${field.name}companyName').val(rec.projectName);
		$('#${field.name}').val(rec.id);
		window.curWin.saveWin();
	}
	
	function clean${field.id}(){		
		$('#${field.name}Id').val("");
		$('#${field.name}companyName').val("");
		$('#${field.name}').val("");
		window.curWin.saveWin();
	}
	
	function clean${field.id}1(){		
		$('#${field.name}Id').val("非规划项目");
		$('#${field.name}companyName').val("非规划项目");
		$('#${field.name}').val("null");
		window.curWin.saveWin();
	}
	</script>